
	;;
	;; Entrance code for freeGSD. This does not much except
	;; allow grup to call the OS and define a few useful routines.
	;;

section .data

section .text

MULTIBOOT_PAGE_ALIGN   equ 1<<0
MULTIBOOT_MEMORY_INFO  equ 1<<1

MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
CHECKSUM               equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)

; The Multiboot header (in NASM syntax)
align 4
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd CHECKSUM

extern	main

global	start

start:
	;; 
	;; Well, now we are here (Duh).
	;; Status of things at this point: no paging, no interupts, but we DO have a GDT
	;; First, start the stack at 0x00210000 (65KBytes of stack space).
	;; Next thing to do is push the address of the boot info passed by
	;; GRUB and then call the kernel.c starting address.
	;;
	mov	esp,	0x00210000
	
	push	ebx
	call	main
	
	;; If we get to here (ideally, we shouln't) hang.
	jmp	hang

hang:
	jmp	hang
